#!/bin/env python
# -*- coding: utf-8 -*-

#加密
def en(data):
    result = ""
    for char in data:
        char_code = ord(char)
        if(char_code <= 127) :
            char_code += 128
        else :
            char_code -= 128

        result += "%02X" % (char_code)
    return result

#解密
def de(data):
    result = ""
    length = len(data)
    i = 0
    while(i < length):
        char_code = int(data[i] + data[i+1], 16)
        if(char_code <= 127) :
            char_code += 128
        else :
            char_code -= 128
        result += chr(char_code)
        i += 2
    return result
